<template>
  <table>
    <tr>
      <td>订单数量:</td>
      <td>
        <input type="text" v-model="Stats.order_Num">
      </td>
    </tr>
    <tr>
      <td>实际收款:</td>
      <td>
          <input type="text" v-model="Stats.actual_Collection">
      </td>
    </tr>
    <tr>
      <td>平均价格:</td>
      <td>
          <input type="text" v-model="Stats.average_Price">
      </td>
    </tr>
    <tr>
      <td>退款金额:</td>
      <td>
          <input type="text" v-model="Stats.refund_Amount">
      </td>
    </tr>
    <tr>
      <td>销售趋势:</td>
      <td>
          <input type="text" v-model="Stats.sales_Trends">
      </td>
    </tr>
    <tr>
      <td>门店编号:</td>
      <td>
        <input type="text" v-model="Stats.shop_Id">
      </td>
    </tr>
        <tr>
    
      <td colspan="2">
          <input type="button" value="添加门店营业信息数据" @click="AddShopStats">
      </td>
    </tr>
  </table>
</template>

<script setup lang="ts">
import { ref } from "vue";
import axios from "axios";


const Stats = ref({
  shopStats_Id: 0,
  order_Num: 0,
  actual_Collection: 0,
  average_Price: 0,
  refund_Amount: 0,
  sales_Trends: "",
  shop_Id: 0,

});

const AddShopStats = () => {
    axios.post('https://localhost:7071/api/ShopStats/AddShopStats', Stats.value)
        .then(res => {
            if (res.data > 0) {
            alert("添加成功")
            }
            else {
            alert("添加失败")
        }
        })
        .catch(err => {
        console.log(err)
    })
}
</script>

<style scoped>
</style>